{% extends "base_content.html" %}
{% load engine_tags %}


{% block headtitle %}
    {{ data.name }}
{% endblock %}

{% block ribbon %}
    {% include 'widgets/upload_button.html' %}
{% endblock %}

{% block content %}

<div class="data" data-value="{{ data.uid }}">

        <div class="ui divided items">

            <div class="item">
                <div class="content">
                    <a class="subheader" href="{% url 'data_view' data.uid %}">
                        <i class="file icon"></i>Data: {{ data.get_name }}
                    </a>

                    <div class="meta">
                        <div class="ui small labels">
                            {% size_label data %}
                            {% type_label data %}
                            {%  created_by date=data.lastedit_date user=data.lastedit_user %}
                        </div>
                    </div>
                </div>
            </div>


        </div>

    <div class="ui large center aligned vertical segment" style="padding: 0px">

            <a class="ui button" href="{% url 'data_edit' data.uid %}">
                <i class="edit icon"></i> <span class="tablet">Edit Data</span>
            </a>

            <a class="ui copy button">
                <i class="copy icon"></i>Copy Data
            </a>
               <a class="ui button tablet" href="{% url 'data_delete' data.uid %}">
                    {% if project.deleted %}
                        <i class="trash icon"></i> <span class="tablet">Restore Data</span>
                    {% else %}
                        <i class="trash icon"></i> <span class="tablet">Delete Data</span>
                    {% endif %}
                </a>

          <a class="ui button" href="{% url 'data_download' data.uid %}">
                <i class="download icon"></i> <span class="tablet">Download Data</span>
            </a>
    </div>

</div>
    <div class="ui vertical large segment">
        <div class="ui aligned header">Data List</div>
        <div>Files contained in the dataset</div>
        {% include 'widgets/files_list.html' %}
    </div>

    {% if data.html %}
        <div class="ui vertical large segment">
            <div class="ui aligned header">Data Info</div>
            <div>{{ data.html|safe }}</div>
        </div>
    {% endif %}

    <div class="ui vertical large segment">
        <div class="ui aligned header">Data Content</div>
        <pre>{{ data.peek }}</pre>
    </div>
    <div class="ui vertical large segment">
        <div class="ui aligned header">Table of Contents</div>
        <pre>{{ data.table_of_contents|join:"" }}</pre>
    </div>


{% endblock %}
